package com.gxa.hystrix.controller;

import com.gxa.hystrix.service.CheckService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @author thinknovo
 * @version 1.0
 * @description CheckController.java
 * @date 2021/3/11 9:30
 */
@RestController
@RequestMapping(value = "keShi", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class KeShiController {
    @Resource
    private CheckService checkService;

    /*
    这里类似于ribbon，提供一个对外访问的接口地址，
    然后根据serviceFeignByCheck接口来决定调用哪一个子模块服务和哪一个接口地址
     */
    @GetMapping("chaXunAll")
    public Map chaXunKeShi() {
        return checkService.chaXunKeShi();
    }
}
